<!-- src/components/BackToHomeButton.vue -->
<template>
  <button @click="goHome">返回首页</button>
</template>

<script setup>
import { useRouter } from 'vue-router';

const router = useRouter();

const goHome = () => {
  router.push({ name: 'home' });  // 使用路由跳转到首页
};
</script>

<style scoped>
button {
  position: fixed;
  right: 20px;
  bottom: 30px;
  padding: 10px 20px;
  background-color: #42b983;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

button:hover {
  background-color: #36a176;
}
</style>
